package com.example.hosptial.model.enity;

import jakarta.persistence.*;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.util.List;

@Data
@Entity
@Table(name = "floor")
public class Floor {
    @Id
    @Min(value = 1, message = "楼层必须大于等于1")
    @Max(value = 10, message = "楼层必须小于等于10")
    private Integer floorNum;

    @ManyToOne
    @JoinColumn(name = "deptId")
    private Department department;

    @OneToMany(mappedBy = "floor")
    private List<Ward> wards;
} 